package com.woniuxy.secondhand.controller;


import com.woniuxy.life.core.api.CommonResult;
import com.woniuxy.secondhand.entity.SecCollects;
import com.woniuxy.secondhand.service.SecCollectsService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 二手收藏 前端控制器
 * </p>
 *
 * @author chaohuijiang
 * @since 2020-09-24
 */
@RestController
@RequestMapping("/secondhand/sec-collects")
public class SecCollectsController {
    @Resource
    SecCollectsService secCollectsService;
//添加收藏
    public CommonResult<SecCollects> insert(SecCollects secCollects){
        secCollectsService.save(secCollects);
        return CommonResult.success();
    }
    //删除
    public CommonResult<SecCollects> delete(Integer collectsId ){
        secCollectsService.removeById(collectsId);
        return CommonResult.success();
    }
}
